<template>
    <div>
    <el-collapse v-model="activeNames">
      
        <el-collapse-item v-for="order,index in orders" :key="order._id"
        :title="'订单号：' + order._id +  '下单时间：'  +  order.addTime" :name="index" style="padding-left:10px">
        <el-table ref="multipleTable" :data="order.products" tooltip-effect="dark"
        style="overflow: hidden">
            <el-table-column prop="imgPath" label="图片" width="80">
            <template slot-scope="scope">
            <img :src="'/products/' +scope.row.imgPath " alt="" width="100%">
          </template>
            </el-table-column>
            <el-table-column prop="productName" label="名称" width="290">
            </el-table-column>
            <el-table-column prop="type" label="类型" width="150">
            </el-table-column>
            <el-table-column prop="price" label="单价" width="200">
            </el-table-column>
            <el-table-column prop="num" label="数量" width="150">
            </el-table-column>
            </el-table>
            <slot :order="order"></slot>
        </el-collapse-item>
    </el-collapse>
</div>
</template>


<script>
export default {
    name: 'OrderDetail',
    props:['orders'],
    data(){
            return {
                activeNames:['1']
            }
        }
}
</script>